<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/hexo_blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/hexo_blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/hexo_blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/hexo_blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/hexo_blog/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.2/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.css">
  <script src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.js"></script>

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"bone-nails.gitee.io","root":"/hexo_blog/","images":"/hexo_blog/images","scheme":"Gemini","version":"8.2.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/hexo_blog/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":true,"preload":true}};
  </script>
<meta name="description" content="centos安装和网络配置 安装VMware虚拟机">
<meta property="og:type" content="article">
<meta property="og:title" content="centos安装和网络配置">
<meta property="og:url" content="https://bone-nails.gitee.io/2021/04/01/centos%E5%AE%89%E8%A3%85%E5%92%8C%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/index.html">
<meta property="og:site_name" content="Carson Zhao">
<meta property="og:description" content="centos安装和网络配置 安装VMware虚拟机">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFOCU5OSU5QSVFNiU4QiU5RiVFNyVCRCU5MSVFNyVCQiU5QyVFNyVCQyU5NiVFOCVCRSU5MSVFNSU5OSVBOC5QTkc?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL05BVCVFOCVBRSVCRSVFNyVCRCVBRS5QTkc?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL0VOUzMzLlBORw?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL2lwdjQuUE5H?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFOSU5RCU5OSVFNiU4MCU4MWlwLlBORw?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL25ldC10b29scy5QTkc?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL25ldC10b29sczIuUE5H?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL2lwY29uZmlnYWxsLlBORw?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVBMSVBNSVFNiU4RSVBNS5QTkc?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVBMSVBNSVFNiU4RSVBNTIuUE5H?x-oss-process=image/format,png">
<meta property="og:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVCNSU4QiVFOCVBRiU5NS5QTkc?x-oss-process=image/format,png">
<meta property="article:published_time" content="2021-04-01T04:23:20.000Z">
<meta property="article:modified_time" content="2021-04-01T04:20:15.270Z">
<meta property="article:author" content="Carson Zhao">
<meta property="article:tag" content="CentOS">
<meta property="article:tag" content="Linux">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFOCU5OSU5QSVFNiU4QiU5RiVFNyVCRCU5MSVFNyVCQiU5QyVFNyVCQyU5NiVFOCVCRSU5MSVFNSU5OSVBOC5QTkc?x-oss-process=image/format,png">


<link rel="canonical" href="https://bone-nails.gitee.io/2021/04/01/centos%E5%AE%89%E8%A3%85%E5%92%8C%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>
<title>centos安装和网络配置 | Carson Zhao</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

<link rel="alternate" href="/hexo_blog/atom.xml" title="Carson Zhao" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/hexo_blog/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Carson Zhao</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/hexo_blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-about"><a href="/hexo_blog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li>
        <li class="menu-item menu-item-tags"><a href="/hexo_blog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li>
        <li class="menu-item menu-item-categories"><a href="/hexo_blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#centos%E5%AE%89%E8%A3%85%E5%92%8C%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE"><span class="nav-number">1.</span> <span class="nav-text">centos安装和网络配置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85VMware%E8%99%9A%E6%8B%9F%E6%9C%BA"><span class="nav-number"></span> <span class="nav-text">安装VMware虚拟机</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#02-%E5%AE%89%E8%A3%85Centos%E9%95%9C%E5%83%8F"><span class="nav-number"></span> <span class="nav-text">02.安装Centos镜像</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#NAT%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE"><span class="nav-number"></span> <span class="nav-text">NAT网络配置</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#01-%E6%89%93%E5%BC%80VMWare%E8%99%9A%E6%8B%9F%E6%9C%BA%EF%BC%8C%E9%80%89%E6%8B%A9%E7%BC%96%E8%BE%91-%E8%99%9A%E6%8B%9F%E7%BD%91%E7%BB%9C%E7%BC%96%E8%BE%91%E5%99%A8%EF%BC%8C%E9%80%89%E6%8B%A9VMWare8%EF%BC%8C%E5%AD%90%E7%BD%91%E5%9C%B0%E5%9D%80%E4%B8%BA%EF%BC%9A192-168-45-0%EF%BC%8C%E5%AD%90%E7%BD%91%E6%8E%A9%E7%A0%81%E4%B8%BA%EF%BC%9A255-255-255-0"><span class="nav-number"></span> <span class="nav-text">01.打开VMWare虚拟机，选择编辑-虚拟网络编辑器，选择VMWare8，子网地址为：192.168.45.0，子网掩码为：255.255.255.0</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#02-%E7%82%B9%E5%87%BBNAT%E8%AE%BE%E7%BD%AE%EF%BC%8C%E8%99%9A%E6%8B%9F%E6%9C%BAip%E8%B7%AF%E7%94%B1%E4%B8%BA%EF%BC%9A192-168-45-2"><span class="nav-number"></span> <span class="nav-text">02.点击NAT设置，虚拟机ip路由为：192.168.45.2</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#03-%E8%8E%B7%E5%8F%96IP%E5%9C%B0%E5%9D%80%EF%BC%88%E4%B8%A4%E7%A7%8D%EF%BC%9A%E5%8A%A8%E6%80%81IP%E5%92%8C%E9%9D%99%E6%80%81IP%EF%BC%89"><span class="nav-number"></span> <span class="nav-text">03.获取IP地址（两种：动态IP和静态IP）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8A%A8%E6%80%81%E8%8E%B7%E5%8F%96IP%EF%BC%9A"><span class="nav-number">1.</span> <span class="nav-text">动态获取IP：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%AE%BE%E7%BD%AE%E9%9D%99%E6%80%81IP%E5%9C%B0%E5%9D%80"><span class="nav-number">2.</span> <span class="nav-text">设置静态IP地址</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#04-%E5%AE%89%E8%A3%85net-tools%EF%BC%88%E7%9B%AE%E7%9A%84%EF%BC%9A%E4%B8%BA%E4%BA%86%E8%83%BD%E5%A4%9F%E4%BD%BF%E7%94%A8-ifconfig%E6%9F%A5%E7%9C%8B%E7%BD%91%E5%8D%A1%E9%85%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89"><span class="nav-number"></span> <span class="nav-text">04.安装net-tools（目的：为了能够使用#ifconfig查看网卡配置信息）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#05-%E5%AE%89%E8%A3%85wget-bzip2-bind-utils%E7%AD%89%E7%9B%B8%E5%85%B3%E5%8C%85"><span class="nav-number"></span> <span class="nav-text">05.安装wget&#x2F;bzip2&#x2F;bind-utils等相关包</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%A1%A5%E6%8E%A5%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE"><span class="nav-number"></span> <span class="nav-text">桥接网络配置</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#01-%E6%9F%A5%E7%9C%8B%E7%83%AD%E7%82%B9ip%E5%9C%B0%E5%9D%80"><span class="nav-number"></span> <span class="nav-text">01.查看热点ip地址</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#02-%E9%85%8D%E7%BD%AE%E7%BD%91%E5%8D%A1"><span class="nav-number"></span> <span class="nav-text">02.配置网卡</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#03-%E6%94%B9%E6%A1%A5%E6%8E%A5%E6%A8%A1%E5%BC%8F"><span class="nav-number"></span> <span class="nav-text">03.改桥接模式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#04-%E6%B5%8B%E8%AF%95"><span class="nav-number"></span> <span class="nav-text">04.测试</span></a></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Carson Zhao"
      src="/hexo_blog/images/1.png">
  <p class="site-author-name" itemprop="name">Carson Zhao</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/hexo_blog/archives">
          <span class="site-state-item-count">59</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/hexo_blog/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/hexo_blog/tags/">
          
        <span class="site-state-item-count">35</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="cc-license site-overview-item animated" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="cc-opacity" rel="noopener" target="_blank"><img src="/hexo_blog/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://bone-nails.gitee.io/2021/04/01/centos%E5%AE%89%E8%A3%85%E5%92%8C%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/hexo_blog/images/1.png">
      <meta itemprop="name" content="Carson Zhao">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Carson Zhao">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          centos安装和网络配置
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>
      

      <time title="创建时间：2021-04-01 12:23:20 / 修改时间：12:20:15" itemprop="dateCreated datePublished" datetime="2021-04-01T12:23:20+08:00">2021-04-01</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/hexo_blog/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>1k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>1 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h3 id="centos安装和网络配置"><a href="#centos安装和网络配置" class="headerlink" title="centos安装和网络配置"></a>centos安装和网络配置</h3><span id="more"></span>
<h2 id="安装VMware虚拟机"><a href="#安装VMware虚拟机" class="headerlink" title="安装VMware虚拟机"></a>安装VMware虚拟机</h2><p>我使用的<a target="_blank" rel="noopener" href="https://zzj-1300408493.cos.ap-chengdu.myqcloud.com/%E5%B7%A5%E5%85%B7%E5%BA%93/VMware%2015.5.0/VMware%2015.5.0.exe">Vmware15</a>存放在我的腾讯云中，有需要者自提。只需一步步安装即可。</p>
<h2 id="02-安装Centos镜像"><a href="#02-安装Centos镜像" class="headerlink" title="02.安装Centos镜像"></a>02.安装Centos镜像</h2><p><a target="_blank" rel="noopener" href="https://zzj-1300408493.cos.ap-chengdu.myqcloud.com/%E5%B7%A5%E5%85%B7%E5%BA%93/CentOS-7-x86_64-Minimal-1804.iso">镜像</a>下载自提,下载完后在虚拟机中安装centos即可。</p>
<h1 id="NAT网络配置"><a href="#NAT网络配置" class="headerlink" title="NAT网络配置"></a>NAT网络配置</h1><h2 id="01-打开VMWare虚拟机，选择编辑-虚拟网络编辑器，选择VMWare8，子网地址为：192-168-45-0，子网掩码为：255-255-255-0"><a href="#01-打开VMWare虚拟机，选择编辑-虚拟网络编辑器，选择VMWare8，子网地址为：192-168-45-0，子网掩码为：255-255-255-0" class="headerlink" title="01.打开VMWare虚拟机，选择编辑-虚拟网络编辑器，选择VMWare8，子网地址为：192.168.45.0，子网掩码为：255.255.255.0"></a>01.打开VMWare虚拟机，选择编辑-虚拟网络编辑器，选择VMWare8，子网地址为：192.168.45.0，子网掩码为：255.255.255.0</h2><p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFOCU5OSU5QSVFNiU4QiU5RiVFNyVCRCU5MSVFNyVCQiU5QyVFNyVCQyU5NiVFOCVCRSU5MSVFNSU5OSVBOC5QTkc?x-oss-process=image/format,png"></p>
<h2 id="02-点击NAT设置，虚拟机ip路由为：192-168-45-2"><a href="#02-点击NAT设置，虚拟机ip路由为：192-168-45-2" class="headerlink" title="02.点击NAT设置，虚拟机ip路由为：192.168.45.2"></a>02.点击NAT设置，虚拟机ip路由为：192.168.45.2</h2><p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL05BVCVFOCVBRSVCRSVFNyVCRCVBRS5QTkc?x-oss-process=image/format,png"></p>
<h2 id="03-获取IP地址（两种：动态IP和静态IP）"><a href="#03-获取IP地址（两种：动态IP和静态IP）" class="headerlink" title="03.获取IP地址（两种：动态IP和静态IP）"></a>03.获取IP地址（两种：动态IP和静态IP）</h2><h3 id="动态获取IP："><a href="#动态获取IP：" class="headerlink" title="动态获取IP："></a>动态获取IP：</h3><ul>
<li><code>#vi /etc/sysconfig/network-scripts/ifcfg-ens33</code>,按下图进行修改：(BOOTPROTO=DHCP,ONBOOT=YES)<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL0VOUzMzLlBORw?x-oss-process=image/format,png"><br>配置完后重启网络即可，相关指令：<code>#systemctl restart network</code>，如此动态IP就配置好了，可以ping外网，若不行，参考<a target="_blank" rel="noopener" href="https://1125609158.github.io/CentOS-ping%E4%B8%8D%E9%80%9A%E5%A4%96%E7%BD%91%E5%8E%9F%E5%9B%A0%E8%A7%A3%E6%9E%90.html#more">这篇博客</a>，逐一排查。<h3 id="设置静态IP地址"><a href="#设置静态IP地址" class="headerlink" title="设置静态IP地址"></a>设置静态IP地址</h3></li>
<li>更改网络适配器：无线网图标右键-打开“网络和Internet设置”-更改适配器选项-选中VMnet8右键属性，双击ipv4，按下图进行设置（确保与虚拟机在同一网段）：</li>
<li><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL2lwdjQuUE5H?x-oss-process=image/format,png"></li>
<li><code>#vi /etc/sysconfig/network-scripts/ifcfg-ens33</code>,按下图进行修改：(BOOTPROTO=STATIC,ONBOOT=YES,加IP地址，子网掩码，网关和dns服务器)<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFOSU5RCU5OSVFNiU4MCU4MWlwLlBORw?x-oss-process=image/format,png"><br>配置完后重启网络即可，相关指令：<code>#systemctl restart network</code>，如此动态IP就配置好了，可以ping外网，若不行，参考<a target="_blank" rel="noopener" href="https://1125609158.github.io/CentOS-ping%E4%B8%8D%E9%80%9A%E5%A4%96%E7%BD%91%E5%8E%9F%E5%9B%A0%E8%A7%A3%E6%9E%90.html#more">这篇博客</a>，逐一排查。<h2 id="04-安装net-tools（目的：为了能够使用-ifconfig查看网卡配置信息）"><a href="#04-安装net-tools（目的：为了能够使用-ifconfig查看网卡配置信息）" class="headerlink" title="04.安装net-tools（目的：为了能够使用#ifconfig查看网卡配置信息）"></a>04.安装net-tools（目的：为了能够使用#ifconfig查看网卡配置信息）</h2><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL25ldC10b29scy5QTkc?x-oss-process=image/format,png"><br>光盘用完后记得卸载：#umount /dev/cdrom/<br>net-tools安装后还可以使用以下指令：<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL25ldC10b29sczIuUE5H?x-oss-process=image/format,png"></li>
</ul>
<h2 id="05-安装wget-bzip2-bind-utils等相关包"><a href="#05-安装wget-bzip2-bind-utils等相关包" class="headerlink" title="05.安装wget/bzip2/bind-utils等相关包"></a>05.安装wget/bzip2/bind-utils等相关包</h2><blockquote>
<p>#yum install bzips<br>#yum install bind-utils<br>#yum install wget  </p>
</blockquote>
<h1 id="桥接网络配置"><a href="#桥接网络配置" class="headerlink" title="桥接网络配置"></a>桥接网络配置</h1><h2 id="01-查看热点ip地址"><a href="#01-查看热点ip地址" class="headerlink" title="01.查看热点ip地址"></a>01.查看热点ip地址</h2><ul>
<li>电脑连接手机热点后，在本机终端中输入<code>#ipconfig/all</code>,查看热点的默认网关，如下图：<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBL2lwY29uZmlnYWxsLlBORw?x-oss-process=image/format,png">  <h2 id="02-配置网卡"><a href="#02-配置网卡" class="headerlink" title="02.配置网卡"></a>02.配置网卡</h2></li>
<li>登录CentOS，终端输入<code>#nmtui</code>对网卡按如下图进行修改,同时激活网卡。<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVBMSVBNSVFNiU4RSVBNS5QTkc?x-oss-process=image/format,png"><h2 id="03-改桥接模式"><a href="#03-改桥接模式" class="headerlink" title="03.改桥接模式"></a>03.改桥接模式</h2></li>
<li>将网络适配器改为桥接模式，如下图：<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVBMSVBNSVFNiU4RSVBNTIuUE5H?x-oss-process=image/format,png">  <h2 id="04-测试"><a href="#04-测试" class="headerlink" title="04.测试"></a>04.测试</h2></li>
<li>ping虚拟机IP地址以及外网：</li>
<li><code>#ping 192.168.43.200</code></li>
<li><code>#ping www.baidu.com</code>如下图：<br><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly96emotMTMwMDQwODQ5My5jb3MuYXAtY2hlbmdkdS5teXFjbG91ZC5jb20vJUU1JTlCJUJFJUU1JUJBJThBLyVFNiVCNSU4QiVFOCVBRiU5NS5QTkc?x-oss-process=image/format,png"></li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>Carson Zhao
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://bone-nails.gitee.io/2021/04/01/centos%E5%AE%89%E8%A3%85%E5%92%8C%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/" title="centos安装和网络配置">https://bone-nails.gitee.io/2021/04/01/centos安装和网络配置/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

          <div class="post-tags">
              <a href="/hexo_blog/tags/CentOS/" rel="tag"># CentOS</a>
              <a href="/hexo_blog/tags/Linux/" rel="tag"># Linux</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/hexo_blog/2021/04/01/hexo-coding%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/" rel="prev" title="hexo+coding搭建博客">
                  <i class="fa fa-chevron-left"></i> hexo+coding搭建博客
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/hexo_blog/2021/04/01/%E6%95%B0%E6%8D%AE%E5%BA%93%E6%BC%94%E7%BB%83oracle11g/" rel="next" title="数据库演练oracle11g">
                  数据库演练oracle11g <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Carson Zhao</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">125k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">1:54</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script size="300" alpha="0.6" zIndex="-1" src="https://cdn.jsdelivr.net/npm/ribbon.js@1.0.2/dist/ribbon.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/hexo_blog/js/utils.js"></script><script src="/hexo_blog/js/next-boot.js"></script>

  
<script src="/hexo_blog/js/local-search.js"></script>



<script>
if (document.querySelectorAll('.pdf-container').length) {
  NexT.utils.getScript('https://cdn.jsdelivr.net/npm/pdfobject@2.2.4/pdfobject.min.js', () => {
    document.querySelectorAll('.pdf-container').forEach(element => {
      PDFObject.embed(element.dataset.target, element, {
        pdfOpenParams: {
          navpanes : 0,
          toolbar  : 0,
          statusbar: 0,
          pagemode : 'thumbs',
          view     : 'FitH'
        },
        PDFJS_URL: '/hexo_blog/lib/pdf/web/viewer.html',
        height   : element.dataset.height
      });
    });
  }, window.PDFObject);
}
</script>


  <script>
    NProgress.configure({
      showSpinner: true
    });
    NProgress.start();
    document.addEventListener('readystatechange', () => {
      if (document.readyState === 'interactive') {
        NProgress.inc(0.8);
      }
      if (document.readyState === 'complete') {
        NProgress.done();
      }
    });
    document.addEventListener('pjax:send', () => {
      NProgress.start();
    });
    document.addEventListener('pjax:success', () => {
      NProgress.done();
    });
  </script>

  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





<script src="/hexo_blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/hexo_blog/live2dw/assets/hijiki.model.json"},"display":{"position":"right","width":200,"height":400},"mobile":{"show":true},"log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
